#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <vector>
#include <map>
#include <queue>
#include <cstdio>
#include <string>
#include <stack>
#include <set>
#define IOS ios::sync_with_stdio(false), cin.tie(0)
using namespace std;
typedef long long ll;
ll num[1000010];

int main()
{
    IOS;
    num[0]=7%3;num[1]=11%3;
    for(ll i=2;i<=1000000;i++){
        num[i]=(num[i-1]+num[i-2])%3;
    }
    ll n;
    while(cin>>n){
        if(num[n]==0)cout<<"yes"<<endl;
        else cout<<"no"<<endl;
    }
    getchar();
    getchar();
    return 0;
}
